package com.epin.base.enums.commons;

/**
 * <p>中国大写金额枚举</p>
 * @author DELL
 *
 */
public enum ChineseCapitalEnum {
	
	/**
	 * 1
	 */
	ONE(1, "壹"),
	/**
	 * 2
	 */
	TWO(2, "贰"),
	/**
	 * 3
	 */
	THREE(3, "叁"),
	/**
	 * 4
	 */
	FOUR(4, "肆"),
	/**
	 * 5
	 */
	FIVE(5, "伍"),
	/**
	 * 6
	 */
	SIX(6, "陆"),
	/**
	 * 7
	 */
	SEVEN(7, "柒"),
	/**
	 * 8
	 */
	EIGHT(8, "捌"),
	/**
	 * 9
	 */
	NINE(9, "玖"),
	/**
	 * 0
	 */
	ZERO(0, "零");

	
	private int value;
	private String message;
	
	private ChineseCapitalEnum(int value, String message) {
		this.value = value;
		this.message = message;
	}
	
	public int val() {
		return value;
	}
	
	public String msg(){
		return message;
	}
	
	
	public static String toString(int value) {
		
		for (ChineseCapitalEnum e : ChineseCapitalEnum.values()) {
			if (e.value == value) {
				return e.message;
			}
		}
		
		return "";
	}
	
	
	public static int toValue(String message){
		for (ChineseCapitalEnum e : ChineseCapitalEnum.values()) {
			if (e.message.equals(message)) {
				return e.value;
			}
		}
		
		return 0;
	}
}
